<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Swagger\Annotations as SWG;

/**
 * https://github.com/zircote/swagger-php/blob/master/Examples/swagger-spec/petstore-simple/SimplePetsController.php
 * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
 * http://editor.swagger.io/#/
 *
 * curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/x-www-form-urlencoded' 'http://dev.engine.com/api/oauth/token?client_id=1&client_secret=jrik0zlnB0hlAaqs7aZv3grlS9Ssg3vleFxD12QP&grant_type=password&username=test%40test.com&password=password'
 */

/**
 * @SWG\Swagger(
 *     basePath="/api",
 *     host="http://thearte.jumpcity.cn/",
 *     schemes={"http"},
 *     produces={"application/json"},
 *     consumes={"application/json"},
 *     @SWG\Info(
 *         version="1.0",
 *         title="Engine",
 *         description="Engine接口文档",
 *         termsOfService="http://helloreverb.com/terms/",
 *         @SWG\Contact(name="Yoki"),
 *     )
 * )
 */

/**
 * @SWG\Post(
 *     summary="用户登陆",
 *     path="/oauth/token",
 *     description="使用账号密码获取令牌",
 *     @SWG\Parameter(
 *         name="client_id",
 *         in="query",
 *         description="客户端id",
 *         required=true,
 *         type="integer",
 *         default="1"
 *     ),
 *     @SWG\Parameter(
 *         name="client_secret",
 *         in="query",
 *         description="客户端私钥",
 *         required=true,
 *         type="string",
 *         default="jrik0zlnB0hlAaqs7aZv3grlS9Ssg3vleFxD12QP"
 *     ),
 *     @SWG\Parameter(
 *         name="grant_type",
 *         in="query",
 *         description="授权类型",
 *         required=true,
 *         type="string",
 *         default="password"
 *     ),
 *     @SWG\Parameter(
 *         name="username",
 *         in="query",
 *         description="用户名",
 *         required=true,
 *         type="string",
 *         default="13816993553"
 *     ),
 *     @SWG\Parameter(
 *         name="password",
 *         in="query",
 *         description="密码",
 *         required=true,
 *         type="string",
 *         default="password"
 *     ),
 *     @SWG\Response(
 *         response=200,
 *         description=""
 *     ),
 * )
 *
 * @SWG\Post(
 *     summary="用户注册",
 *     path="/user/register",
 *     description="用户注册",
 *     @SWG\Parameter(
 *         name="username",
 *         in="query",
 *         description="用户名",
 *         required=true,
 *         type="integer"
 *     ),
 *     @SWG\Parameter(
 *         name="password",
 *         in="query",
 *         description="密码",
 *         required=true,
 *         type="string"
 *     ),
 *     @SWG\Parameter(
 *         name="name",
 *         in="query",
 *         description="名称",
 *         required=true,
 *         type="string"
 *     ),
 *     @SWG\Response(
 *         response=200,
 *         description=""
 *     ),
 * )
 */
class SwaggerController extends Controller
{
    public function doc()
    {
        return '{"swagger":"2.0","info":{"title":"Engine","description":"Engine\u63a5\u53e3\u6587\u6863","termsOfService":"http:\/\/helloreverb.com\/terms\/","contact":{"name":"Yoki"},"version":"1.0"},"host":"http:\/\/thearte.jumpcity.cn","basePath":"\/api","schemes":["http"],"consumes":["application\/json"],"produces":["application\/json"],"paths":{"\/oauth\/token":{"post":{"summary":"\u7528\u6237\u767b\u9646","description":"\u4f7f\u7528\u8d26\u53f7\u5bc6\u7801\u83b7\u53d6\u4ee4\u724c","parameters":[{"name":"client_id","in":"query","description":"\u5ba2\u6237\u7aefid","required":true,"type":"integer","default":"1"},{"name":"client_secret","in":"query","description":"\u5ba2\u6237\u7aef\u79c1\u94a5","required":true,"type":"string","default":"jrik0zlnB0hlAaqs7aZv3grlS9Ssg3vleFxD12QP"},{"name":"grant_type","in":"query","description":"\u6388\u6743\u7c7b\u578b","required":true,"type":"string","default":"password"},{"name":"username","in":"query","description":"\u7528\u6237\u540d","required":true,"type":"string","default":"13816993553"},{"name":"password","in":"query","description":"\u5bc6\u7801","required":true,"type":"string","default":"password"}],"responses":{"200":{"description":""}}}},"\/user\/register":{"post":{"summary":"\u7528\u6237\u6ce8\u518c","description":"\u7528\u6237\u6ce8\u518c","parameters":[{"name":"username","in":"query","description":"\u7528\u6237\u540d","required":true,"type":"integer"},{"name":"password","in":"query","description":"\u5bc6\u7801","required":true,"type":"string"},{"name":"name","in":"query","description":"\u540d\u79f0","required":true,"type":"string"}],"responses":{"200":{"description":""}}}},"\/draft":{"get":{"summary":"\u8349\u7a3f\u8be6\u60c5","description":"\u7528\u6237\u8349\u7a3f\u8be6\u60c5","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"}],"responses":{"200":{"description":""}}},"post":{"summary":"\u521b\u5efa\u6216\u4fee\u6539\u8349\u7a3f","description":"\u7528\u6237\u521b\u5efa\u6216\u4fee\u6539\u8349\u7a3f","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"},{"name":"title","in":"query","description":"\u5267\u672c\u6807\u9898","required":true,"type":"string"},{"name":"category_id","in":"query","description":"\u5267\u672c\u5206\u7c7b","required":true,"type":"integer"},{"name":"page_turn_way","in":"query","description":"\u7ffb\u9875\u65b9\u5f0f(default:1)","required":false,"type":"integer","default":1},{"name":"is_cycle","in":"query","description":"\u5faa\u73af\u64ad\u653e(0-\u5426[default],1-\u662f)","required":false,"type":"integer","default":0},{"name":"is_auto","in":"query","description":"\u81ea\u52a8\u64ad\u653e(0-\u5426[default],1-\u662f)","required":false,"type":"integer","default":0},{"name":"sections","in":"query","description":"\u7ae0\u8282\u6570\u636e(json\u683c\u5f0f):\u5fc5\u8981\u53c2\u6570title[\u6807\u9898], sequence[\u987a\u5e8f], css, properties","required":false,"type":"string"}],"responses":{"200":{"description":""}}}},"\/extend":{"get":{"summary":"\u6269\u5c55\u6570\u636e","description":"\u83b7\u53d6\u6240\u6709\u6269\u5c55\u6570\u636e","produces":["application\/x-www-form-urlencoded"],"responses":{"200":{"description":""}}}},"\/image\/public":{"get":{"summary":"\u516c\u5171\u56fe\u7247\u5217\u8868","description":"\u83b7\u53d6\u516c\u5171\u56fe\u7247\u5217\u8868","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"}],"responses":{"200":{"description":""}}}},"\/image":{"get":{"summary":"\u7528\u6237\u56fe\u7247\u5217\u8868","description":"\u83b7\u53d6\u7528\u6237\u56fe\u7247\u5217\u8868","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"}],"responses":{"200":{"description":""}}},"post":{"summary":"\u7528\u6237\u4e0a\u4f20\u56fe\u7247","description":"\u7528\u6237\u4e0a\u4f20\u56fe\u7247","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"},{"name":"image","in":"query","description":"\u56fe\u7247(base64)","required":true,"type":"string"}],"responses":{"200":{"description":""}}},"delete":{"summary":"\u7528\u6237\u5220\u9664\u56fe\u7247","description":"\u7528\u6237\u5220\u9664\u56fe\u7247","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"},{"name":"image_name","in":"query","description":"\u56fe\u7247\u540d\u79f0(\u53ea\u9700\u8981\u6587\u4ef6\u540d)","required":true,"type":"string"}],"responses":{"200":{"description":""}}}},"\/play":{"get":{"summary":"\u5267\u672c\u5217\u8868","description":"\u83b7\u53d6\u7528\u6237\u7684\u5267\u672c\u5217\u8868","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"},{"name":"page","in":"query","description":"\u9875\u7801[default:1]","required":false,"type":"integer"},{"name":"per_page","in":"query","description":"\u6bcf\u9875\u6761\u6570[default:15]","required":false,"type":"integer"}],"responses":{"200":{"description":""}}},"post":{"summary":"\u521b\u5efa\u5267\u672c","description":"\u7528\u6237\u521b\u5efa\u5267\u672c","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"},{"name":"title","in":"query","description":"\u5267\u672c\u6807\u9898","required":true,"type":"string"},{"name":"category_id","in":"query","description":"\u5267\u672c\u5206\u7c7b","required":true,"type":"integer"},{"name":"page_turn_way","in":"query","description":"\u7ffb\u9875\u65b9\u5f0f(default:1)","required":false,"type":"integer","default":1},{"name":"is_cycle","in":"query","description":"\u5faa\u73af\u64ad\u653e(0-\u5426[default],1-\u662f)","required":false,"type":"integer","default":0},{"name":"is_auto","in":"query","description":"\u81ea\u52a8\u64ad\u653e(0-\u5426[default],1-\u662f)","required":false,"type":"integer","default":0},{"name":"sections","in":"query","description":"\u7ae0\u8282\u6570\u636e(json\u683c\u5f0f):\u5fc5\u8981\u53c2\u6570title[\u6807\u9898], sequence[\u987a\u5e8f], css, properties","required":false,"type":"string"}],"responses":{"200":{"description":""}}}},"\/play\/{id}":{"get":{"summary":"\u5267\u672c\u8be6\u60c5","description":"\u7528\u6237\u5267\u672c\u8be6\u60c5","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"},{"name":"id","in":"path","description":"\u5267\u672cid","required":true,"type":"integer"}],"responses":{"200":{"description":""}}},"put":{"summary":"\u4fee\u6539\u5267\u672c","description":"\u7528\u6237\u4fee\u6539\u5267\u672c","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"},{"name":"id","in":"path","description":"\u5267\u672cid","required":true,"type":"integer"},{"name":"name","in":"query","description":"\u5267\u672c\u540d\u79f0","required":true,"type":"string"},{"name":"category_id","in":"query","description":"\u5267\u672c\u5206\u7c7b","required":true,"type":"integer"},{"name":"page_turn_way","in":"query","description":"\u7ffb\u9875\u65b9\u5f0f(default:1)","required":false,"type":"integer","default":"1"},{"name":"is_cycle","in":"query","description":"\u5faa\u73af\u64ad\u653e(0-\u5426[default],1-\u662f)","required":false,"type":"integer","default":"0"},{"name":"is_auto","in":"query","description":"\u81ea\u52a8\u64ad\u653e(0-\u5426[default],1-\u662f)","required":false,"type":"integer","default":"0"},{"name":"sections","in":"query","description":"\u7ae0\u8282\u6570\u636e(json\u683c\u5f0f):\u5fc5\u8981\u53c2\u6570id, title[\u6807\u9898], sequence[\u987a\u5e8f], css, properties","required":false,"type":"string"}],"responses":{"200":{"description":""}}},"delete":{"summary":"\u5220\u9664\u5267\u672c","description":"\u7528\u6237\u5220\u9664\u5267\u672c","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"},{"name":"id","in":"path","description":"\u5267\u672cid","required":true,"type":"integer"}],"responses":{"200":{"description":""}}}},"\/template":{"get":{"summary":"\u6a21\u677f\u5217\u8868","description":"\u83b7\u53d6\u6240\u6709\u5217\u8868","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"page","in":"query","description":"\u9875\u7801[default:1]","required":false,"type":"integer"},{"name":"per_page","in":"query","description":"\u6bcf\u9875\u6761\u6570[default:15]","required":false,"type":"integer"}],"responses":{"200":{"description":""}}}},"\/template\/{id}":{"get":{"summary":"\u6a21\u677f\u8be6\u60c5","description":"\u6a21\u677f\u8be6\u60c5","produces":["application\/x-www-form-urlencoded"],"parameters":[{"name":"Authorization","in":"header","description":"\u6388\u6743\u4ee4\u724c[Bearer <token>]","required":true,"type":"string"},{"name":"id","in":"path","description":"\u5267\u672cid","required":true,"type":"integer"}],"responses":{"200":{"description":""}}}}},"definitions":[]}';

//        return response()->json($swagger);
    }
}